{extend name='main'}

{block name="button"}

{if auth("druser")}
<button data-modal='{:url("druser")}' data-title="导入维修师傅" class='layui-btn layui-btn-sm layui-btn-primary'>导入维修师傅</button>
{/if}
{if auth("add")}
<button data-modal='{:url("add")}' data-title="添加师傅" class='layui-btn layui-btn-sm layui-btn-primary'>添加师傅</button>
{/if}
{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些师傅吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除师傅</button>
{/if}


{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='user/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>师傅姓名</th>
            <th class='text-left nowrap'>身份证号</th>
            <th class='text-left nowrap'>工种</th>
            <th class='text-center nowrap'>联系电话</th>
            <th class='text-center nowrap'>维修工单次数</th>
            <th class='text-center nowrap'>登录系统次数</th>
            <th class='text-left nowrap'>最后登录ip</th>
            <th class='text-left nowrap'>最后登录时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>{$vo.sf_name|default=''}</td>
            <td class='text-left nowrap'>{$vo.sf_sfzh|default='-'}</td>
            <td class='text-left nowrap'>{$vo.sf_gz|default='-'}</td>
            <td class='text-center nowrap'>{$vo.sf_tel|default=0}</td>
            <td class='text-center nowrap'>{$vo.wxcs|default=0}</td>
            <td class='text-center nowrap'>{$vo.dlcs|default=0}</td>
            <td class='text-left nowrap'>{$vo.loginip|default='-'}</td>
            <td class='text-left nowrap'>{$vo.logintime|default='-'}</td>
            <td class='text-left nowrap'>

                {if auth("pass")}
                <a class="layui-btn layui-btn-normal layui-btn-sm" data-title="设置密码" data-modal='{:url("pass")}?id={$vo.id}'>密 码</a>
                {/if}

                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑用户" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if $vo.bxsf_status eq 1 and auth("forbid")}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};bxsf_status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
                {elseif $vo.bxsf_status eq 0 and auth("resume")}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};bxsf_status#1" data-csrf="{:systoken('resume')}">启 用</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该用户吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
